import Vue from 'vue'
import App from './App.vue'
import axios from 'axios'
import router from './sa-resources/router.js'
import {request,requestJson,requestJsonMap} from './static/http/request'

Vue.prototype.$axios = axios;
Vue.prototype.request=request;
Vue.prototype.requestJson=requestJson;
Vue.prototype.requestJsonMap=requestJsonMap;
Vue.config.productionTip = false;

//json化
import qs from 'qs'

//axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
Vue.prototype.qs = qs;
Vue.prototype.axios = axios;

//json前台展示
import JsonViewer from 'vue-json-viewer'
Vue.use(JsonViewer);

// 安装 element-ui 
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);

// 安装jquery与layer, (cdn方式引入的直接挂载到原型)
Vue.prototype.$ = window.$;
Vue.prototype.layer = window.layer;

// 安装sa对象
import sa from './static/sa.js';
Vue.prototype.sa = sa;
window.sa=sa
import zm from './static/zm'
Vue.prototype.zm=zm

import './static/sa.css';

// 安装sa_admin初始化方法
import SaAdminInIt from './sa-resources/sa-admin-init.js';
import im from "@/sa-view/im/im";

Vue.prototype.SaAdminInIt = SaAdminInIt;


// 打开vue 
const vue=new Vue({
    render: h => h(App),
    router:router,
    beforeCreate(){
        Vue.prototype.$bus=this
    }
}).$mount('#app')

export default vue